﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="score_modi.aspx.cs" Inherits="EZCRS.HCMS.Web.manage.carduser.score_modi" %>
<%@ Register Src="../usercontrol/titlepage.ascx" TagName="titlepage" TagPrefix="uc2" %>
<%@ Register Assembly="Book38.Net.CustomControl" Namespace="Book38.Net.CustomControl"
    TagPrefix="cc1" %>

<%@ Register Src="../usercontrol/jspage.ascx" TagName="jspage" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
      <title></title>
     
      <script src="../../Common/base_grid.js" language="javascript" type="text/javascript"></script>  
    
    
   
   <script src="../../common/calendar1.js" language="javascript" type="text/javascript"></script>
   <script type="text/javascript" src="../../common/jquery-1.2.6.min.js"></script>
 </head>
<body onload="Page_Load('First');">
    <form id="form1" runat="server">
    <uc2:titlepage id="Titlepage1" runat="server" inittitle="常客积分管理"></uc2:titlepage>
    
        <table class="main-table"  cellpadding="1" cellspacing="1">
            <tr class="line-even">
               <td style="text-align: center; height: 24px;">
                   时间：
                
                    <input id="bstart" class="text-line" style="width: 100px" type="text" runat="server"
                       value="yyyy-MM-dd"/>&nbsp;-
                    <input id="bend" class="text-line" style="width: 100px" type="text" 
                       value="yyyy-MM-dd" runat="server"/>
              &nbsp;
                    <asp:DropDownList ID="logsort" runat="server">
                    </asp:DropDownList>
                    &nbsp;
                    <asp:DropDownList ID="avild" runat="server">
                    </asp:DropDownList>&nbsp;
                <asp:Button  ID="BtnSearch"  runat="server" CssClass="bttn" OnClientClick="javascript:Page_Load('Search');return false;" Text="<%$ Resources:Site, ButtonSearch %>" /></td> 
                
            </tr>
        </table><br />
        <table width="100%" cellpadding="1" cellspacing="1">
         <tr>
           <td align="right"  width="30%">
               <a href="javascript:modistatus();" class="blue" onmouseover="currentcolor=this.style.backgroundColor;this.style.backgroundColor='#B9CEEA';" onmouseout="this.style.backgroundColor=currentcolor;"><img src="../../image/delete.gif" border="0"/>修改状态</a>&nbsp;
               </td>
         </tr>
        </table>
    <input type="hidden" id="orderkey" value="0" /><asp:HiddenField ID="uid" runat="server" Value="0" /><input type="hidden" id="txt_sql" value="" />
    
  <br /><uc1:jspage id="Jspage1" runat="server">
    </uc1:jspage>
   <br />
   <div class="main-table" style="float:left;color:Black" id="buyscore" runat="server"><div style="float:left;line-height:24px;" class="title1">购买积分</div>
             当前比率：<asp:Label ID="scorerate" runat="server" Text="Label"></asp:Label>/100人民币；购买金额：<cc1:webtextbox
                 id="totalmoney" runat="server" cssclass="text-line" validtype="Float" width="60px"><Value>
</Value>
</cc1:webtextbox>（人民币）<input id="Button1"
                     class="bttn" type="button" value="购买" onclick="buy();"/></div></form>
   <script type="text/javascript">
    function Page_Load(pageindex)
    {//debugger
        var sstr=$F("uid").value+"|";
        sstr+=$FDate("bstart")+"|";
        sstr+=$FDate("bend")+"|";
        sstr+=$F("logsort").value+"|";
        sstr+=$F("avild").value;
        pageindex=pageIndexSetting(pageindex);    //pageindex的设定
        EZCRS.HCMS.myajax.CardUserUtils.cardscorelist(pageindex, sstr,setTable);
        pageLastSetting(sstr,pageindex);     //最后的赋值 
    }
    
    function modistatus()
   {
    if(!confirm("<%= Resources.Site.ScriptConfirm %>"))
     return;
     
    var logidlist=$F("hidlogid").value.split(',');
    var dellogid="";
    for(i=0;i<logidlist.length;i++)
    {
      if($F("cbx"+logidlist[i]).checked)
       {  dellogid+=","+logidlist[i];}
    }
    EZCRS.HCMS.myajax.CardUserUtils.cardscorestatus(dellogid,delresp);
   }
  
   function delresp(resp)
   {
     if(resp.value=="1")
     {
       alert("所选日志状态已经改变！");
       Page_Load("First");
     }
     else
     {  alert("<%= Resources.Site.ScriptDelFalse %>");}
   }
   
   function buy()
   {
     if(!confirm("<%= Resources.Site.ScriptConfirm %>"))
     return;
     
     if($F("totalmoney").value=="")
     {
      return;
     }
     debugger
     EZCRS.HCMS.myajax.CardUserUtils.cardscorebuy($F("uid").value,$F("totalmoney").value,upresp);
   }
   
   function upresp(resp)
   {
     if(resp.value=="0")
     { alert("积分购买失败，请稍候重试！");}
     else
     {
      alert(resp.value+"积分购买完成！");
      $F("totalmoney").value="";
     }
   }
   
    AjaxPro.timeoutPeriod = 40000;
    var l = $F("loadinfo");
    AjaxPro.onLoading = function(b)
    {
        l.innerHTML="<img src=\"../../Image/loading.gif\" alt=\"Loading\" align=\"absmiddle\" /><%= Resources.Site.LabLoadInfo %>";
    }    
    AjaxPro.onError = function(e) 
    {
        l.innerHTML="<%= Resources.Site.LabLoadErrInfo %>";
    } 
    AjaxPro.onTimeout = function(t) 
    {
        l.innerHTML="<%= Resources.Site.LabLoadErrInfo %>";
    }
    
   
   </script> 

    
   
</body>
</html>

